<script type="text/html" template lay-done="layui.data.done(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-corecmsdriverdeliveryarea-createForm" id="LAY-app-corecmsdriverdeliveryarea-createForm">

        <!--	<div class="layui-form-item">
        <label for="id" class="layui-form-label  layui-form-required"></label>
        <div class="layui-input-block">
            <input  type="number" min="0" max="999999" name="id"   lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入" lay-reqText="请输入并为数字"  />
        </div>
    </div>-->



        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">司机：</label>
            <div class="layui-input-inline">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <select name="driverId">
                    <option value="" selected="selected">请选择</option>
                    {{# layui.each(d.params.data.drivers, function(index, item){ }}
                    <option value="{{ item.id }}">{{ item.name }}</option>
                    {{# }); }}
                </select>
            </div>
        </div>

        <!--<div class="layui-form-item">
        <label for="drivers" class="layui-form-label  layui-form-required">司机</label>
        <div class="layui-input-block">
            <div id="selectDriverBox" class="xm-select-demo"></div>
        </div>
    </div>-->
  

        <!--<div class="layui-form-item">
            <label for="areaId" class="layui-form-label  layui-form-required">地区</label>
            <div class="layui-input-block">
                <div id="selectAreasBox" class="xm-select-demo"></div>
            </div>
        </div>-->

        <div class="layui-form-item">
            <label for="areaId" class="layui-form-label  layui-form-required">地区</label>
            <div class="layui-input-block">
                <textarea name="areaId" id="areaId" lay-verify="required" class="layui-textarea" lay-reqText="输入邮编前3位,多个邮编用,分割.如:082,098" placeholder="输入邮编前3位,多个邮编用,分割.如:082,098"></textarea>
            </div>
        </div>




        <!--	<div class="layui-form-item">
        <label for="createTime" class="layui-form-label  layui-form-required">创建时间</label>
        <div class="layui-input-block">
            <input name="createTime"  id="createTime-corecmsdriverdeliveryarea-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间"  />
        </div>
    </div>
    -->
        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-corecmsdriverdeliveryarea-createForm-submit" id="LAY-app-corecmsdriverdeliveryarea-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    var debug= layui.setter.debug;
    layui.data.done = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'xmSelect', 'cropperImg'],
        function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , laydate = layui.laydate
                , upload = layui.upload
                , xmSelect = layui.xmSelect
                , cropperImg = layui.cropperImg
                , coreHelper = layui.coreHelper;

            /*var selectDriverBox = xmSelect.render({
                el: '#selectDriverBox',
                tips: '请选择司机',
                name: 'drivers',
                layVerify: 'required',
                prop: {
                    name: 'name',
                    value: 'id',
                },
                data: d.params.data.drivers
            })*/
            var selectAreasBox = xmSelect.render({
                el: '#selectAreasBox',
                tips: '请选择地区',
                name: 'areaId',
                layVerify: 'required',
                prop: {
                    name: 'name',
                    value: 'id',
                },
                data: d.params.data.areas
            })

            laydate.render({
                elem: '#createTime-corecmsdriverdeliveryarea-createTime',
                type: 'datetime'
            });
	        form.verify({
                
	        });
            //重载form
            form.render(null, 'LAY-app-corecmsdriverdeliveryarea-createForm');
        })
    };
</script>
